<% @pagetitle ||= "Flawmill" -%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title><%= @pagetitle %></title>
  <link rel="shortcut icon" href="/images/favicon.ico" />
  <%= stylesheet_link_tag 'flawmill' %>
  <%= javascript_include_tag :all, :cache => true %>
  <% if @has_feed -%>
  <%= auto_discovery_link_tag :rss, params.merge({:format => :rss}) %>
  <% end -%>
</head>
<body>

<div id="page_container">
  <div id="non_footer">
    <div id="header">
      <div id="user_info">
        <p>
          <% if @current_user -%>
            You are logged in as <%= link_to @current_user.display, user_url(@current_user) %>.  <%= link_to "Logout?", :controller => "welcome", :action => "logout" %>
          <% else -%>
            You are not logged in.  <%= link_to "Login now?", :controller => "welcome", :action => "login" %>
          <% end -%>
        </p>
      </div>
      <div id="logo">
        <%= link_to '<span id="flaw">flaw</span><span id="mill">mill</span><span id="beta">beta</span>',
                    welcome_url %>
      </div>
      <div id="menu">
        <ul id="nav">
          <li><%= link_to 'Issues', url_for(:controller => 'issues', :project_id => @project.name), :class =>  ( ( params[:controller] == 'issues' ) ? 'selected' : '') if @project %></li>
          <li>
            <%= link_to 'Projects', projects_url, :class => ( ( params[:controller] == 'projects' ) ?
                                                                'selected' : '' )%>
          </li>
          <li>
            <%= link_to 'Home', welcome_url, :class => ( ( params[:controller] == 'welcome' ) ?
                                                            'selected' : '' )%>
          </li>
        </ul>
        <ul id="project_nav">
          <% if @project and not @project.new_record? -%>
          <li><%= link_to @project.name, project_url( @project.name ), :class => 'project' %></li>
          <% end -%>
        </ul>
        <div style="clear: both;"></div>
      </div>
    </div>
    <div id="content">
      <%= render :partial => 'shared/flash', :locals => { :flash => flash } %>
      <%= yield %>
    </div>
  </div>
	<div style="clear: both;"></div>
  <div id="footer">
    <p id="creds"><%= PAGE_FOOTER_TAGLINE %></p>
  </div>
</div>

</body>
</html>
